export const titleTypes = {
    1: "阅读",
    2: "连载",
    3: "问答",
    4: "音乐",
    5: "影视",
    8: "电台",
    11: "专题",
}

export const categoryNames = {
    0: "hp", // "图文"
    1: "essay", // "阅读"
    2: "serialcontent", // "连载"
    3: "question", //"问答"
    4: "music", //"音乐"
    5: "movie", // "影视"
    // 6: "连载",
    8: "radio", // "电台"
    11: "topic", // "专题"
}

export const getHpDetail = ({
    axios,
    date
}) => {
    return axios.get('https://apis.netstart.cn/one/hp/bydate/' + date)
}

// 文章详情API

export const getArticleDetail = ({
    axios,
    id,
    category
}) => {

    let categoryName = categoryNames[category]
    if (!categoryName) {
        console.error("未知分类：", category)
    }
    return axios.get(`https://apis.netstart.cn/one/${categoryName}/htmlcontent/${id}`)
}

// 文章评论API
export const getArticleDetailComment = ({
    axios,
    id,
    category
}) => {
    let categoryName = categoryNames[category]
    if (!categoryName) {
        console.error("未知分类：", category)
    }
    if (categoryName == "serialcontent") {
        categoryName = "serial"
    }
    return axios.get(`https://apis.netstart.cn/one/comment/praiseandtime/${categoryName}/${id}/0`)

}